<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Client Driver APIs</title>
    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Getting Started with Distributed Berkeley DB Applications" />
    <link rel="up" href="introduction.html" title="Chapter 1. Introduction to Building Distributed Applications with Berkeley DB" />
    <link rel="prev" href="introduction.html" title="Chapter 1. Introduction to Building Distributed Applications with Berkeley DB" />
    <link rel="next" href="connection.html" title="Secure Connections" />
  </head>
  <body>
    <div xmlns="" class="navheader">
      <div class="libver">
        <p>Library Version 12.1.6.2</p>
      </div>
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Client Driver APIs</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="introduction.html">Prev</a> </td>
          <th width="60%" align="center">Chapter 1. Introduction to Building Distributed Applications with Berkeley DB</th>
          <td width="20%" align="right"> <a accesskey="n" href="connection.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="intro.client"></a>Client Driver APIs</h2>
          </div>
        </div>
      </div>
      <p>
			The client driver APIs are modeled after Berkeley DB <span>Java base</span> APIs
			with most 
			<span>class</span> names prefixed with an
			'S', which stands for server. For example, 
			
			<span>the <code class="classname">Database</code>
			class</span> is named 
			
			<span>the <code class="classname">SDatabase</code>
			class</span> in the driver APIs. <span> All
			classes in the client driver APIs are located in the
			<code class="classname">com.sleepycat.client</code> package.
			</span>
		</p>
      <p>
			In addition, the client driver provides <span>
			the <code class="classname">BdbServerConnection</code> class,</span>
			which can be used to establish a connection to a server and also
			serves as the starting point to everything else in the client driver
			APIs. For example, client environment handles are created like this:
		</p>
      <pre class="programlisting">BdbServerConnection conn = 
		BdbServerConnection.connect("localhost", 8080);
SEnvironment env = conn.openEnvironment("env", 
		new SEnvironmentConfig().setAllowCreate(true)); </pre>
      <p>
			The <code class="classname">BdbServerConnection</code>
			class is not thread-safe. Furthermore, all objects created from a
			<code class="classname">BdbServerConnection</code> instance use the
			connection object internally. Thus, they must be accessed in the
			same thread as the connection object, or at least their accesses
			must be serialized. This rule applies recursively to handles created
			from environment handles (which are created from connection
			objects). Therefore, the entire object graph rooted at a single
			<code class="classname">BdbServerConnection</code> instance must be
			accessed in a single thread, or accessed serially. 
		</p>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="introduction.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="introduction.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="connection.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">Chapter 1. Introduction to Building Distributed Applications with Berkeley DB </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> Secure Connections</td>
        </tr>
      </table>
    </div>
  </body>
</html>
